Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Windows.Forms
Imports CanteraElP.Reportes

Partial Public Class FrmMenuPrincipal
    Inherits Form
    Private childFormNumber As Integer = 0

    Public Sub New()
        InitializeComponent()
    End Sub

    Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs)
        Dim childForm As New Form()
        childForm.MdiParent = Me
        childForm.Text = "Ventana " & System.Math.Max(System.Threading.Interlocked.Increment(childFormNumber), childFormNumber - 1)
        childForm.Show()
    End Sub



    Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles exitToolStripMenuItem.Click
        Me.Close()
    End Sub


    Private Sub CloseAllToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)
        For Each childForm As Form In MdiChildren
            childForm.Close()
        Next
    End Sub

    Private Sub toolsMenu_Click(ByVal sender As Object, ByVal e As EventArgs) Handles toolsMenu.Click
        Dim cli As New FrmClient(False)
        cli.MdiParent = Me
        cli.Show()

    End Sub

    Private Sub productoToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles productoToolStripMenuItem.Click
        Dim prod As New FrmProducto()
        prod.MdiParent = Me
        prod.Show()
    End Sub


    Private Sub nuevoPedidoToolStripMenuItem1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles nuevoPedidoToolStripMenuItem1.Click
        'if (MessageBox.Show("Desea agregar contactos al cliente", "¿AGREGAR CONTACTOS?", MessageBoxButtons.YesNo) == DialogResult.Yes
        Dim remito As New FrmPedido()
        remito.MdiParent = Me
        remito.Show()
    End Sub

    Private Sub listadoDePedidosToolStripMenuItem1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles listadoDePedidosToolStripMenuItem1.Click
        Dim lista As New FrmListadoGralPedidos()
        lista.MdiParent = Me
        lista.Show()
    End Sub

    Private Sub obraToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles obraToolStripMenuItem.Click
        Dim obra As New FrmObras()
        obra.MdiParent = Me
        obra.Show()
    End Sub

    Private Sub nuevoRemitoToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles nuevoRemitoToolStripMenuItem.Click
        Dim remit As New FrmListadoPedidos
        remit.MdiParent = Me
        remit.Show()
    End Sub

    Private Sub listadoRemitosToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles listadoRemitosToolStripMenuItem.Click
        Dim remit As New FrmListadoGralRemitos()
        remit.MdiParent = Me
        remit.Show()
    End Sub


    Private Sub LocalidadesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LocalidadesToolStripMenuItem.Click
        Dim local As New FrmLocalidad()
        local.MdiParent = Me
        local.Show()

    End Sub

    Private Sub BarriosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BarriosToolStripMenuItem.Click
        Dim barrio As New FrmBarrios()
        barrio.MdiParent = Me
        barrio.Show()
    End Sub

    Private Sub RubrosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RubrosToolStripMenuItem.Click
        Dim rubro As New FrmRubro
        rubro.MdiParent = Me
        rubro.Show()
    End Sub

    Private Sub UnidadDeMedidaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UnidadDeMedidaToolStripMenuItem.Click
        Dim um As New FrmUnidadMedida
        um.MdiParent = Me
        um.Show()
    End Sub
End Class
